<?php

class IndexController extends Zend_Controller_Action
{
    protected $articleModel;

    protected function getArticleModel() {
        if(is_null($this->articleModel)) {
            require_once 'Article.php';
            $this->articleModel = new Article();
        }

        return $this->articleModel;
    }
    
    public function init()
    {
        $this->view->controleur="index";
    }

    public function indexAction()
    {
        // ligne à modifier pour remplir la page d'accueil
        $this->view->articleList = $this->getArticleModel()->getLatestArticle(10);
        $this->view->action = "index";
    }

    public function aboutAction()
    {
        $this->view->action = "about";
    }
}

